using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Data;
using DTO;

namespace DAO
{
  public static  class ThongtinsachDAO
    {
      public static DataSet Loaisach_sach(OleDbConnection connection)
      {
          DataSet ds = new DataSet();
          OleDbDataAdapter da1 = new OleDbDataAdapter("select *from Loaisach", connection);
          OleDbDataAdapter da2 = new OleDbDataAdapter("select * from Sach", connection);
          da1.Fill(ds, "LS");
          da2.Fill(ds, "sach");

          DataColumn cotcha = new DataColumn();
          DataColumn cotcon = new DataColumn();

          cotcha = ds.Tables["LS"].Columns["Maloai"];
          cotcon = ds.Tables["sach"].Columns["Maloai"];
          ds.Relations.Add("LS_sach", cotcha, cotcon);

          connection.Close();
          return ds;
      }
    }
}
